﻿using System.Linq;
using System.Web.Mvc;
using Quickie.Models;
using Quickie.Models.IoC;
using Quickie.Models.Data;
using Quickie.Models.Entities;
using Quickie.Models.ViewModel;
using Quickie.Models.Interfaces;

namespace Quickie.Controllers
{
    [Authorize(Roles = "Administrator,Korisnik")]
    public class CompanyController : Controller
    {
        private IRepository<Company> companies;

        public CompanyController(IRepository<Company> companies)
        {
            this.companies = companies;
        }

        public ActionResult MainMenu()
        {
            var viewModel = new MenuCompanyModel();
            viewModel.Companies = companies.GetAll().ToList();

            return View(viewModel);
        }

        

    }
}
